package com.shenglue.ssi.service;

import java.util.List;

import com.shenglue.ssi.dao.UserDao;
import com.shenglue.ssi.domain.User;

public class UserServiceImpl implements UserService {

	private UserDao userDao;

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}


	/**
	 * 判断登录用户是否存在
	 */
	public User isUser(User user) {
		user.getName().trim();
		user.getPassword().trim();
		return userDao.isUser(user);
	}

	/**
	 * 查询所有用户
	 */
	public List<User> selectUser() {
		return userDao.selectUser();
	}

	/**
	 * 添加用户
	 */
	public boolean saveUser(User user) {
		user.getName().trim();
		user.getPassword().trim();
		return userDao.saveUser(user);
	}

	/**
	 * 修改用户信息
	 */
	public boolean updateUser(User user) {
		return userDao.updateUser(user);
	}

	/**
	 * 删除用户
	 */
	public boolean deleteUser(String userName) {
		return userDao.deleteUser(userName);
	}

}
